package com.byit.domain;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author wangx
 * @since 2019-01-03
 */
@Data
@TableName("app_user")
public class AppUser extends Model<AppUser> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 匿名
     */
    private String anonymous;
    /**
     * 姓名
     */
    @TableField("user_name")
    private String userName;
    /**
     * 密码
     */
    private String password;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 身份证
     */
    @TableField("id_card")
    private String idCard;
    /**
     * 账户类型
     */
    @TableField("type")
    private Integer type;
    /**
     * 用户状态
     */
    private Integer status;
    /**
     * 删除标志 0未删除 1已删除
     */
    @TableField("is_del")
    private Integer isDel;
    /**
     * 认证状态  0未认证  1已认证
     */
    @TableField("auth_state")
    private Integer authState;
    /**
     * 性别 0女  1男  2 其他
     */
    @TableField("sex")
    private Integer sex;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 修改时间
     */
    @TableField("modifiy_time")
    private Date modifiyTime;
    /**
     * 设备标识
     */
    @TableField("device_id")
    private String deviceId;
    /**
     * 设备名称
     */
    @TableField("device_name")
    private String deviceName;
    /**
     * 设备操作系统
     */
    @TableField("device_system")
    private String deviceSystem;
    /**
     * 个性签名
     */
    @TableField("signature")
    private String signature;
    /**
     * 登录时间
     */
    @TableField("login_time")
    private Date loginTime;

    /**
     * token
     */
    @TableField(exist = false)
    private String token;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "AppUser{" +
                ", id=" + id +
                ", anonymous=" + anonymous +
                ", userName=" + userName +
                ", password=" + password +
                ", avatar=" + avatar +
                ", phone=" + phone +
                ", idCard=" + idCard +
                ", type=" + type +
                ", status=" + status +
                ", isDel=" + isDel +
                ", authState=" + authState +
                ", sex=" + sex +
                ", createTime=" + createTime +
                ", modifiyTime=" + modifiyTime +
                ", deviceId=" + deviceId +
                ", deviceName=" + deviceName +
                ", deviceSystem=" + deviceSystem +
                ", loginTime=" + loginTime +
                "}";
    }
}
